/**
 * Created by Administrator on 2017/11/6.
 */
//是否代办
 var IP="http://localhost:8080/simple_exchange";

function isProxy(){
    var obj = getFormData();
    if(obj.pProxy.valueOf()==0){
     $("#pProxyIdNumber").css("display","none");
    }else if(obj.pProxy.valueOf()==1){
        $("#pProxyIdNumber").css("display","");
    }
}
//保存
function save() {
    var obj = getFormData();
    if (getstrlength(obj.pName) == 0) {
        alert("用户名不能为空，请输入！！");
        $("#pName").css("border-color", "red");
        return;
    }
    if (getstrlength(obj.pIdNumber) == 0) {
        alert("请输入身份证号码！");
        $("#pIdNumber").css("border-color", "red");
        return;
    }

    if (getstrlength(obj.pHomeAddress) == 0) {
        alert("家庭地址不能为空，请输入！！");
        $("#pHomeAddress").css("border-color", "red");
        return;
    }
    if (getstrlength(obj.pOccupation) == 0) {
        alert("职业不能为空，请输入！！");
        $("#pOccupation").css("border-color", "red");
        return;
    }
    if (getstrlength(obj.pEducation) == 0) {
        alert("学历不能为空，请输入！！");
        $("#pEducation").css("border-color", "red");
        return;
    }
    if (getstrlength(obj.pWorkUnit) == 0) {
        alert("工作单位能为空，请输入！！");
        $("#pWorkUnit").css("border-color", "red");
        return;
    }
    if (getstrlength(obj.pNumber) == 0) {
        alert("电话号码不能为空，请输入！！");
        $("#pNumber").css("border-color", "red");
        return;
    } else if (!isTel(obj.pNumber)) {
        alert("电话号码不合法，请重新输入！！");
        $("#pNumber").css("border-color", "red");
        return;
    }
        var fdaa = $("#pRegform").serialize();
        $.param(fdata);
        $.ajax({
            url: "../securityAccount/p",
            type: "POST",
            data: fdata,
            // processData:false,et=utf-8",
            dataType: "json",
            success: function (data) {
                //var obj=eval("("+result+")");
                //或者$.parsejson(data);
                if (data.code == 0) {
                    alert(data.message);
                    alert("您的账号为"+data.object);
                } else if (data.code == 1) {
                    alert(data.message);
                }
            }
        });

}
/*
//根据个人账号查询个人账户信息
 function pesonalInformaionById() {
     var obj = getFormData();
     if(getstrlength(obj.id)==0){
         alert("个人账户Id不能为空，请输入！！");
         $("#id").css("border-color","red");
         return;
     }
     var pdata = $("#p_select_form").serialize();
      $.param(pdata);
      console.log(pdata);
   //  var data =$("#id"").val();
     $.ajax({
         url:"../securityAccount/state/{id}",
         type:"get",
         data:pdata,
         // processData:false,
         contentType:"application/x-www-form-urlencoded; charset=utf-8",
         dataType:"json",
         success:function(result){
            //1.获取id=cloneTr的tr元素
             var tr= $("#cloneTr");

         }
     });
 }*/







